package org.phoenixframework.api.course.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.phoenixframework.common.entity.annotation.ApiVersion;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by IntelliJ IDEA.
 *
 * @author doublelifeke
 * Email: hautxxxyzjk@163.com
 * DateTime: 2021/7/29 13:31
 * Description:
 */
@Slf4j
@Api(tags = {"ApiVersionControler系统入口控制器"})
@AllArgsConstructor
@RestController
@RequestMapping("/api/{version}")
public class ApiVersionControler {

    @ApiOperation(value = "测试默认")
    @GetMapping("/fun")
    public String funDefault() {
        return "funDefault";
    }

    @ApiOperation(value = "测试2")
    @ApiVersion(5)
    @GetMapping("/fun")
    public String fun5() {
        return "fun 5";
    }

    @ApiOperation(value = "测试9")
    @ApiVersion(9)
    @GetMapping("/fun")
    public String fun9() {
        return "fun 9";
    }

}
